package com.xiaozhen.driver.service.impl;

import com.xiaozhen.common.core.domain.driver.ParseModbusDriver;
import com.xiaozhen.driver.dao.ParseModbusDriverDao;
import com.xiaozhen.driver.service.ParseModbusDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * HISTORY
 *
 * @author zhenweisheng
 * @date 2021/11/17 14:23
 * @description:
 */
@Service
public class ParseModbusDriverServiceImpl implements ParseModbusDriverService {

    @Autowired
    private ParseModbusDriverDao modbusDriverDao;

    @Override
    public int insertDriver(ParseModbusDriver modbusDriver) {
        return modbusDriverDao.insert(modbusDriver);
    }

    @Override
    public int updateDriver(ParseModbusDriver modbusDriver) {
        return modbusDriverDao.updateById(modbusDriver);
    }

    @Override
    public int deleteDriverById(Long driverId) {
        return modbusDriverDao.deleteById(driverId);
    }

    @Override
    public ParseModbusDriver getDriverById(Long driverId) {
        return modbusDriverDao.selectById(driverId);
    }
}
